#!coding:utf-8
# vim: tabstop=4 shiftwidth=4 softtabstop=4

import logging
from cvirt.cnode.libvirtXmlObject.baseDomain import GuestDevice

LOG = logging.getLogger(__name__)


class RedirDevice(GuestDevice):
    ROOT_NAME = "redirdev"
    def __init__(self, parse_xml=None, **kw):
        super(RedirDevice, self).__init__(parse_xml=parse_xml,**kw)
        self.type = 'spicemvc'
        self.bus = 'usb'
    def _parse_xml(self, xmldoc):

        self.type = xmldoc.get('type')
        self.bus = xmldoc.get('bus')

    def _get_xml_config(self, root):
        dev = root
        dev.set('type',self.type)
        dev.set('bus',self.bus)
        return dev